package enums

import "fmt"

type CmdEnum uint8

type Cmd struct {
	C CmdEnum
}

const (
	PPTP_CMD_MAX uint8 = iota
	WAITCMD      //1 待命
	NOCMD        //2 无命令
	RESET        //3 重置
	ERR          //4 错误
	MSG          //5 消息
	GETENV       //6 请求设备信息
	ENV_Q        //7 上报设备信息
	ENV_A        //8 确认上报信息
	BYE          //9 客户端离线
	REGID_Q      //10 注册服务
	REGID_A      //11 注册到服务成功
	REGCH_Q      //12 注册频道
	REGCH_A      //13 注册频道成功
	UNREGCH_Q    //14 反注册频道
	UNREGCH_A    //15 反注册频道成功
	ACK          //16 确认消息
	CMD_MSG      //17 动作消息
)

func (c CmdEnum) String() string {
	switch uint8(c) {
	case PPTP_CMD_MAX:
		return "PPTP_CMD_MAX"
	case WAITCMD:
		return "WAITCMD"
	case NOCMD:
		return "NOCMD"
	case RESET:
		return "RESET"
	case ERR:
		return "ERR"
	case MSG:
		return "MSG"
	case GETENV:
		return "GETENV"
	case ENV_A:
		return "ENV_A"
	case ENV_Q:
		return "ENV_Q"
	case BYE:
		return "BYE"
	case REGID_Q:
		return "REGID_Q"
	case REGID_A:
		return "REGID_A"
	case REGCH_Q:
		return "REGCH_Q"
	case REGCH_A:
		return "REGCH_A"
	case UNREGCH_Q:
		return "UNREGCH_Q"
	case UNREGCH_A:
		return "UNREGCH_A"
	case ACK:
		return "ACK"
	case CMD_MSG:
		return "CMD_MSG"
	default:
		return "UNKNOWN"
	}
}

func GetCmdEnum(enum CmdEnum)  {
	fmt.Printf("enum value: %v\n", enum)
}

